dea0688de9be51992edfc137c4b40f4e5865227a,domain-controller/src/main/java/org/jboss/as/domain/controller/operations/deployment/DeploymentAddHandler.java,DeploymentAddHandler,execute,#OperationContext#ModelNode#ResultHandler#,87
Before Change
String runtimeName = operation.hasDefined(RUNTIME_NAME) ? operation.get(RUNTIME_NAME).asString() : name;
byte[] hash;
if (operation.hasDefined(INPUT_STREAM_INDEX) && operation.hasDefined(HASH)) {
throw new OperationFailedException(new ModelNode().set("Can't pass in both an input-stream-index and a hash"));
} else if (operation.hasDefined(HASH)){
hash = operation.get(HASH).asBytes();
} else if (operation.hasDefined(INPUT_STREAM_INDEX)) {
if (!isMaster) {
// This is a slave DC. We can't handle this operation; it should have been fixed up on the master DC
throw new OperationFailedException(new ModelNode().set("A slave domain controller cannot accept deployment content uploads"));
}
try {
hash = DeploymentUploadUtil.storeDeploymentContent(context, operation, deploymentRepository);
} catch (IOException e) {
throw new OperationFailedException(new ModelNode().set(e.toString()));
}
} else {
throw new OperationFailedException(new ModelNode().set("Neither an attachment nor a hash were passed in"));
}
if (!isMaster || deploymentRepository.hasDeploymentContent(hash)) {
After Change
String runtimeName = operation.hasDefined(RUNTIME_NAME) ? operation.get(RUNTIME_NAME).asString() : name;
byte[] hash;
if (tooManyDeploymentParametersDefined(operation)) {
throw createFailureException("Only allowed one of the following parameters is allowed %s.", VALID_DEPLOYMENT_PARAMETERS);
} else if (operation.hasDefined(HASH)){
hash = operation.get(HASH).asBytes();
} else if (hasValidDeploymentParameterDefined(operation)) {
if (!isMaster) {
// This is a slave DC. We can't handle this operation; it should have been fixed up on the master DC
throw createFailureException("A slave domain controller cannot accept deployment content uploads");
}
try {
hash = DeploymentUploadUtil.storeDeploymentContent(context, operation, deploymentRepository);
} catch (IOException e) {
throw createFailureException(e.toString());
}
} else {
throw createFailureException("None of the following parameters were defined %s.", VALID_DEPLOYMENT_PARAMETERS);
}
if (!isMaster || deploymentRepository.hasDeploymentContent(hash)) {